@ 13, 1 clea to 23,78
@ 13, 4 say "LAST VISIT"
@ 13,24 say "Date of Visit :"
@ 13,54 say "Invoice Number :"
VISIX='VISIT1'
VISIO='VISI01'
TDATE='DATE1'
RANKV='1st'
DO PCON130
DO PCON1300
do pcon50
IF PREV='N'
   RETURN
ENDIF
IF VISIT2<>SPACE(7)
   VISIX='VISIT2'
   VISIO='VISI02'
   TDATE='DATE2'
   RANKV='2nd'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
do pcon50
IF PREV='N'
   RETURN
ENDIF
IF VISIT3<>SPACE(7)
   VISIX='VISIT3'
   VISIO='VISI03'
   TDATE='DATE3'
   RANKV='3rd'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
do pcon50
IF PREV='N'
   RETURN
ENDIF
IF VISIT4<>SPACE(7)
   VISIX='VISIT4'
   VISIO='VISI04'
   TDATE='DATE4'
   RANKV='4th'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
do pcon50
IF PREV='N'
   RETURN
ENDIF
IF VISIT5<>SPACE(7)
   VISIX='VISIT5'
   VISIO='VISI05'
   TDATE='DATE5'
   RANKV='5th'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
DO PCON50
IF VISIT6<>SPACE(7)
   VISIX='VISIT6'
   VISIO='VISI06'
   TDATE='DATE6'
   RANKV='6th'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
DO PCON50
IF PREV='N'
   RETURN
ENDIF
IF VISIT7<>SPACE(7)
   VISIX='VISIT7'
   VISIO='VISI07'
   TDATE='DATE7'
   RANKV='7th'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
DO PCON50
IF PREV='N'
   RETURN
ENDIF
IF VISIT8<>SPACE(7)
   VISIX='VISIT8'
   VISIO='VISI08'
   TDATE='DATE8'
   RANKV='8th'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
DO PCON50
IF PREV='N'
   RETURN
ENDIF
IF VISIT9<>SPACE(7)
   VISIX='VISIT9'
   VISIO='VISI09'
   TDATE='DATE9'
   RANKV='9th'
   DO PCON130
ELSE
   do pcon40
   RETURN
ENDIF
DO PCON1300
do pcon40
RETURN
